package org.leetcode.easy.leetcode415;

public class Solution {

    public static void main(String[] args) {
        String num = addStrings("11", "123");
        System.out.println(num);
    }

    public static String addStrings(String num1, String num2) {
        int n1 = num1.length();
        int n2 = num2.length();

        int [] num1Array = new int[n1];
        int [] num2Array = new int[n2];

        for (int i = 0; i < n1; i++) {
            num1Array[i]=num1.charAt(i)-'0';
        }
        for (int i = 0; i < n2; i++) {
            num2Array[i]=num2.charAt(i)-'0';
        }

        int carry = 0;
        int index1 = n1-1;
        int index2 = n2-1;
        int num_1 = 0;
        int num_2 = 0;
        StringBuilder item = new StringBuilder();
        while (index1>=0 || index2>=0){
            if (index1>=0){
//                num1=
            }else {
                num_1=0;

            }

            if (index2<0){
                num_2=0;
            }

            int num =num_1+num_2+carry;
            carry = num/10;
            num = num%10;
            item.append(num);
            index1--;
            index2--;
        }

        return item.toString();
    }
}
